<?php
session_start();
header('Content-type: text/html; charset=utf-8');

@mysql_connect ('localhost','root','root');

    if(mysql_errno()){
        die(mysql_error());
    }
    mysql_select_db('bolgme');
    mysql_set_charset('utf8');
    $sql = "select name,pass from yonghu where `name`='$_GET[name]' and `pass`='$_GET[pass]'";

    $res = mysql_query($sql);
    $num = mysql_num_rows($res);
    if($num){
        $row = mysql_fetch_array($res);
         echo '<script>alert("登录成功！");window.location.href="zuopin/index.php"</script>';
    }else{
         echo '<script>alert("登录失败！");history.go(-1);</script>';
    }

?>